import { renderElement } from '../renderElement'
import Toast from './Toast'
import { ToastParams } from './types'

export const useToast = (options: ToastParams) => {
	renderElement(Toast, options)
}

export const api =
	(options: Record<string, any>) => (localOptions: ToastParams) => {
		useToast({
			...options,
			...localOptions
		})
	}
